package com.du.spring.pojo;

import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author : DuJiabao
 * @Date : 2021/3/19 13:24
 * @Project : spring
 * @File : null.java
 * @Desc :
 */
@Component
public class User {
  private @NonNull Integer id;
  private String name;

  public User() {
    id = 0;
  }

  public User(int id, String name) {
    this.id = id;
    this.name = name;
  }

  @Nullable
  public Integer getId() {
    return id;
  }

  public void setId(@NonNull Integer id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Override
  public String toString() {
    return "User{" +
            "id=" + id +
            ", name='" + name + '\'' +
            '}';
  }
}
